#ifndef SEARCHWIG_H
#define SEARCHWIG_H

#include <QWidget>
#include <QTcpSocket>
#include <QUdpSocket>


namespace Ui {
class searchwig;
}

class searchwig : public QWidget
{
    Q_OBJECT

public:
    explicit searchwig(QWidget *parent = 0);
    ~searchwig();

private slots:
    void on_search_button_clicked();

    void processUdpResponse();

    void sendDiscoveryBroadcast();

    void connectToTcpServer(const QString &ip, quint16 port);   

    void on_online_button_clicked();

    void readTcpData();

    void handleStatus(const QString &status);

private:
    Ui::searchwig *ui;
    QTcpSocket *tcpSocket;
    QUdpSocket *udpSocket;

signals:
    void IpSignal(const QString ip);

    void UpdateStatus(const QString &status);
};

#endif // SEARCHWIG_H
